Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sambanova inferene #555

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

snova-edwardm
Copy link

@snova-edwardm snova-edwardm commented Dec 2, 2024

What does this PR do?

This PR adds SambaNova as one of the Provider

  • Add SambaNova as a provider

Test Plan

Test the functional command

pytest -s -v --providers inference=sambanova llama_stack/providers/tests/inference/test_embeddings.py llama_stack/providers/tests/inference/test_prompt_adapter.py llama_stack/providers/tests/inference/test_text_inference.py llama_stack/providers/tests/inference/test_vision_inference.py --env SAMBANOVA_API_KEY=<sambanova-api-key>

Test the distribution template:

# Docker
LLAMA_STACK_PORT=5001
docker run -it -p $LLAMA_STACK_PORT:$LLAMA_STACK_PORT \
  llamastack/distribution-sambanova \
  --port $LLAMA_STACK_PORT \
  --env SAMBANOVA_API_KEY=$SAMBANOVA_API_KEY

# Conda
llama stack build --template sambanova --image-type conda
llama stack run ./run.yaml \
  --port $LLAMA_STACK_PORT \
  --env SAMBANOVA_API_KEY=$SAMBANOVA_API_KEY

Source

SambaNova API Documentation

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • [Y] Ran pre-commit to handle lint / formatting issues.
  • [Y] Read the contributor guideline,
    Pull Request section?
  • [Y] Updated relevant documentation.
  • [Y ] Wrote necessary unit or integration tests.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 2, 2024
@snova-edwardm
Copy link
Author

May I get any advise/ comment on this PR?

@ashwinb
Copy link
Contributor

ashwinb commented Jan 14, 2025

Thanks for the updates @snova-edwardm -- could you paste the output of the pytest command? Did all tests pass?

@snova-edwardm
Copy link
Author

snova-edwardm commented Jan 14, 2025

Thanks for the updates @snova-edwardm -- could you paste the output of the pytest command? Did all tests pass?

Here is the output of pytest command.

=================================================================================================================== test session starts ====================================================================================================================
platform linux -- Python 3.11.5, pytest-8.3.4, pluggy-1.5.0 -- llama_stack/venv/bin/python3.11
cachedir: .pytest_cache
rootdir: /llama_stack/llama-stack_dev
configfile: pyproject.toml
plugins: anyio-4.6.2.post1, asyncio-0.24.0
asyncio: mode=Mode.STRICT, default_loop_scope=None
collected 30 items                                                                                                                                                                                                                                         

llama_stack/providers/tests/inference/test_embeddings.py::TestEmbeddings::test_embeddings[llama_8b-sambanova] SKIPPED (This test is only applicable for embedding models)
llama_stack/providers/tests/inference/test_embeddings.py::TestEmbeddings::test_batch_embeddings[llama_8b-sambanova] SKIPPED (This test is only applicable for embedding models)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_model_list[llama_8b-sambanova] PASSED
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_completion[llama_8b-sambanova] SKIPPED (Other inference providers don't support completion() yet)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_completion_logprobs[llama_8b-sambanova] SKIPPED (Other inference providers don't support completion() yet)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_completion_structured_output[llama_8b-sambanova] SKIPPED (This test is not quite robust)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_chat_completion_non_streaming[llama_8b-sambanova] PASSED
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_structured_output[llama_8b-sambanova] SKIPPED (Other inference providers don't support structured output yet)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_chat_completion_streaming[llama_8b-sambanova] PASSED
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_chat_completion_with_tool_calling[llama_8b-sambanova] PASSED
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_chat_completion_with_tool_calling_streaming[llama_8b-sambanova] SKIPPED (Sambanova's tool calling for streaming doesn't work)
llama_stack/providers/tests/inference/test_vision_inference.py::TestVisionModelInference::test_vision_chat_completion_non_streaming[llama_vision-sambanova-image0-expected_strings0] PASSED
llama_stack/providers/tests/inference/test_vision_inference.py::TestVisionModelInference::test_vision_chat_completion_non_streaming[llama_vision-sambanova-image1-expected_strings1] PASSED
llama_stack/providers/tests/inference/test_vision_inference.py::TestVisionModelInference::test_vision_chat_completion_streaming[llama_vision-sambanova] PASSED
llama_stack/providers/tests/inference/test_embeddings.py::TestEmbeddings::test_embeddings[llama_3b-sambanova] SKIPPED (This test is only applicable for embedding models)
llama_stack/providers/tests/inference/test_embeddings.py::TestEmbeddings::test_batch_embeddings[llama_3b-sambanova] SKIPPED (This test is only applicable for embedding models)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_model_list[llama_3b-sambanova] PASSED
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_completion[llama_3b-sambanova] SKIPPED (Other inference providers don't support completion() yet)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_completion_logprobs[llama_3b-sambanova] SKIPPED (Other inference providers don't support completion() yet)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_completion_structured_output[llama_3b-sambanova] SKIPPED (This test is not quite robust)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_chat_completion_non_streaming[llama_3b-sambanova] PASSED
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_structured_output[llama_3b-sambanova] SKIPPED (Other inference providers don't support structured output yet)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_chat_completion_streaming[llama_3b-sambanova] PASSED
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_chat_completion_with_tool_calling[llama_3b-sambanova] SKIPPED (Sambanova's tool calling for lightweight models don't work)
llama_stack/providers/tests/inference/test_text_inference.py::TestInference::test_chat_completion_with_tool_calling_streaming[llama_3b-sambanova] SKIPPED (Sambanova's tool calling for streaming doesn't work)
llama_stack/providers/tests/inference/test_prompt_adapter.py::PrepareMessagesTests::test_system_builtin_only PASSED
llama_stack/providers/tests/inference/test_prompt_adapter.py::PrepareMessagesTests::test_system_custom_and_builtin PASSED
llama_stack/providers/tests/inference/test_prompt_adapter.py::PrepareMessagesTests::test_system_custom_only PASSED
llama_stack/providers/tests/inference/test_prompt_adapter.py::PrepareMessagesTests::test_system_default PASSED
llama_stack/providers/tests/inference/test_prompt_adapter.py::PrepareMessagesTests::test_user_provided_system_message PASSED

======================================================================================================= 15 passed, 15 skipped, 3 warnings in 11.62s ========================================================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants